/**
 * 
 * 
 * Created on 28 apr. 2011 @ 05:26:17 by Laurens Andriessen
 */

package combat.dudes.server.protocol.implementation;

import java.util.ArrayList;

import combat.dudes.protocol.data.DoublePoint;
import combat.dudes.protocol.interfaces.ScenarioInt;


/**
 * 
 * @author Laurens Andriessen
 * @version 1.0
 */
public class Scenario implements ScenarioInt {

	// http://radio-weblogs.com/0122027/stories/2003/10/20/implementingTheSingletonPatternInJava.html
	protected Scenario() {}
	private static Scenario _instance = null;

	private static int scenarioID = 0;
	private static String scenarioName = "";
	private static ArrayList<DoublePoint> waypoints = new ArrayList<DoublePoint>();

	/**
	 * Return the currently used scenario object. If there is no scenario object
	 * set: create one, and only one.
	 * @author Laurens Andriessen
	 * @return ScenarioImp
	 */
	public static Scenario instance() {
		if(_instance == null) {
			_instance = new Scenario();
		}
		return _instance;
	}

	public int getScenarioID() {
		return scenarioID;
	}
	public void setScenarioID(int scenarioID) {
		Scenario.scenarioID = scenarioID;
	}

	public String getScenarioName() {
		return scenarioName;
	}
	public void setScenarioName(String scenarioName) {
		Scenario.scenarioName = scenarioName;
	}

	public ArrayList<DoublePoint> getWaypoints() {
		return (waypoints == null) ? new ArrayList<DoublePoint>() : waypoints;
	}
	public void setWaypoints(ArrayList<DoublePoint> waypoints) {
		Scenario.waypoints = waypoints;
	}

	// TODO Scenario XML-file importing (with teams + vehicles)
	// TODO Scenario XML-file exporting (with teams + vehicles)
}
